<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport"
              content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
        <link rel="icon" href="../img/asset-favico.ico">
        <title>预约详情</title>
        <!--引入样式-->
        <link rel="stylesheet" href="../element-ui/index.css"/>
        <link rel="stylesheet" href="../css/page-health-orderDetail.css"/>
    </head>
    <body data-spy="scroll" data-target="#myNavbar" data-offset="150">
        <div class="app" id="app">
            <!-- 页面头部 -->
            <div class="top-header">
                <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
                <span class="center">健康医疗</span>
                <span class="f-right"><i class="icon-more"></i></span>
            </div>
            <!-- 页面内容 -->
            <div class="contentBox">
                <div class="card">
                    <div class="project-img">
                        <img :src="domain + setmeal.img" v-if="setmeal.img != null && setmeal.img != ''"/>
                    </div>
                    <div class="project-text">
                        <h4 class="tit">{{setmeal.name}}</h4>
                        <p class="subtit">{{setmeal.remark}}</p>
                        <p class="keywords">
                            <span>{{setmeal.sex == '0' ? '性别不限' : setmeal.sex == '1' ? '男' : '女'}}</span>
                            <span>{{setmeal.age}}</span>
                        </p>
                    </div>
                </div>
                <div class="table-listbox">
                    <div class="box-title">
                        <i class="icon-zhen"><span class="path1"></span><span class="path2"></span></i>
                        <span>套餐详情</span>
                    </div>
                    <div class="box-table">
                        <div class="table-title">
                            <div class="tit-item flex2">项目名称</div>
                            <div class="tit-item  flex3">项目内容</div>
                            <div class="tit-item  flex3">项目解读</div>
                        </div>
                        <div class="table-content">
                            <ul class="table-list">
                                <li class="table-item" v-for="checkgroup in setmeal.checkGroups">
                                    <div class="item flex2">{{checkgroup.name}}</div>
                                    <div class="item flex3">
                                        <label v-for="checkitem in checkgroup.checkItems">
                                            {{checkitem.name}}
                                        </label>
                                    </div>
                                    <div class="item flex3">{{checkgroup.remark}}</div>
                                </li>
                            </ul>
                        </div>
                        <div class="box-button">
                            <a class="order-btn" :href="'orderInfo.html?id='+setmeal.id">立即预约</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--引入js-->
        <script src="../js/common.js"></script>
        <script src="../js/axios.min.js"></script>
        <script src="../js/vue.js"></script>
        <script src="../element-ui/index.js"></script>
        <script>
            var vue = new Vue({
                el: "#app",
                data: {
                    setmeal: {}, //套餐详情
                    domain: "" //图片所在域名
                },
                created() {
                    this.findDetail();
                },
                methods: {
                    //查询订单详情
                    findDetail() {
                        //打开全屏遮罩
                        var fullscreenLoading = this.$loading();
                        //获取地址栏参数id
                        var id = getUrlParam("id");

                        axios.get("../setMeal/findDetail/" + id)
                            .then(res => {
                                if (res.data.flag) {
                                    //套餐详情
                                    this.setmeal = res.data.data.setmeal;
                                    //图片所在域名
                                    this.domain = res.data.data.domain;
                                } else {
                                    this.$message.warning(res.data.msg);
                                }

                                //关闭全屏遮罩
                                fullscreenLoading.close();
                            })
                            .catch(error => {
                                this.$message.error("请求出错：" + error);
                                //关闭全屏遮罩
                                fullscreenLoading.close();
                            });
                    }
                }
            });
        </script>
    </body>
</html>